var utils = require('../util/utils')

function equipment(opts) {
    this.id = opts.id || utils.uuNumber()
    this.type = opts.type
    this.state = 2
    this.name = opts.name
    this.lvl = opts.lvl
    this.quality = opts.quality
    this.money = opts.money
    this.attri = opts.attri
    this.exp = opts.exp
    this.classExp = opts.classExp || Math.floor(opts.classLvl * 4 * Math.pow(1.5, opts.quality))
    this.classLvl = opts.classLvl
    this.viceAttri = opts.viceAttri || null
    this.addAttri = opts.addAttri || null
    this.feedMoney = opts.lvl * opts.lvl * opts.quality * 10 //喂养其他装备需要的金钱

}

module.exports = equipment